package com.ikun.appointment.controller;


import com.ikun.appointment.service.CommentService;
import com.ikun.common.entity.Comment;
import com.ikun.common.entity.ResponseResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * 医生评价表(Comment)表控制层
 *
 * @author makejava
 * @since 2024-02-26 10:14:15
 */
@RestController
@RequestMapping("comment")
public class CommentController {
    /**
     * 服务对象
     */
    @Resource
    private CommentService commentService;

    /**
     * 实现评价功能
     */
    @PostMapping("save")
    public ResponseEntity<Integer> save(@RequestBody Comment comment) {
        comment.setCreateTime(LocalDateTime.now());
        commentService.save(comment);
        return ResponseEntity.ok().body(200);

    }

}

